import App from './App.vue'
import m7getCache from '@/utils/m7getCache.js'
import { sync } from 'vuex-router-sync'
import * as XlsxUtil from '@/utils/XlsxUtil.umd.js'
import { NoTransitionTree } from '@/utils/commonJs/initElement.js'
import { initLang, Vue, store, router, i18n, ElementUI } from '@/utils/commonJs/permission.js'
import VueHighcharts from 'vue-highcharts'
import Highcharts from 'highcharts'
import loadMap from 'highcharts/modules/map'
import { codemirror } from 'vue-codemirror'
import 'codemirror/lib/codemirror.css'
import '@/utils/commonJs/initData.js'
import '@/utils/addZhuGeTrack' // 诸葛IO埋点
import '../theme/index.css'
import './assets/reset.styl'
import './assets/report.styl'
import './assets/iconfont/iconfont.css'
import './assets/ele-customize.styl'
import m7Select from './components/ui-modules/select/select.vue'
// import * as Sentry from '@sentry/browser'
// import * as Integrations from '@sentry/integrations'
import cookies from 'vue-cookies'
Vue.prototype.$cookies = cookies
import plTable from 'pl-table'
// import 'pl-table/themes/index.css' // 引入样式（必须引入)，vuecli3.0不需要配置，cli2.0请查看webpack是否配置了url-loader对woff，ttf文件的引用,不配置会报错哦
import 'pl-table/themes/plTableStyle.css' // 默认表格样式很丑 引入这个样式就可以好看啦（如果你不喜欢这个样式，就不要引入，不引入就跟ele表格样式一样）
Vue.use(plTable)
Vue.component(m7Select.name, m7Select)
loadMap(Highcharts)
Vue.use(VueHighcharts, { loadMap })
Vue.use(ElementUI, {
  i18n: (key, value) => i18n.t(key, value)
})
Vue.use(m7getCache)
Vue.use(codemirror)
sync(store, router)
Vue.component('el-tree-no-transition', NoTransitionTree)
initLang()
Vue.config.productionTip = false
Vue.config.silent = process.env.NODE_ENV === 'production'
Vue.config.devtools = process.env.NODE_ENV !== 'production'
XlsxUtil.setWorkerPath('/static/js/xlsxWorker.js')
console.log(process.env.npm_package_config_gddx, 'process.env.npm_package_config_gddx=========================')
if (process.env.NODE_ENV === 'production' && process.env.VUE_APP_NETWORK !== 'test' && !process.env.npm_package_config_gddx) { // 不是广东电信
  // Sentry.init({
  //   dsn: process.env.VUE_APP_NETWORK,
  //   integrations: [new Integrations.Vue({ Vue, attachProps: true })],
  //   release: 'version@12.0.2',
  //   logErrors: true
  // })
}
// 测试环境
// Sentry.init({
//   dsn: 'http://57de43f113b44b588cbb247880143719@123.206.75.142:9000/3',
//   integrations: [new Integrations.Vue({ Vue, attachProps: true })],
//   release: 'version@12.0.2',
//   logErrors: true
// })
new Vue({
  i18n,
  router,
  store,
  render: h => h(App)
}).$mount('#app')
